﻿/************************************************
*
* Copyright(c) ZeeGuo.com
*
* CLR : 4.0.30319.296
*
* FileName : Site7k7kComicStorage.cs
*
* Author : Kurodo
*
* CreatTime : 2013/7/19 16:57:49
*           
*************************************************/

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComicSpider;

namespace ComicSite
{
    public class Site7k7kComicStorage : IComicStorage
    {
        public string StorageComic(string uri, string folder)
        {
            string fileName = uri.ToString().Substring(uri.ToString().LastIndexOf(".cn") + 4);
            fileName = fileName.Replace('/', '\\').Substring(1);
            string fileDire = fileName.Substring(0, fileName.LastIndexOf("\\"));
            string file = string.Format("{0}\\{1}", folder, fileName);
            string director = string.Format("{0}\\{1}", folder, fileDire);

            DirectoryInfo directory = Directory.CreateDirectory(director);

            return file;
        }
    }
}
